from django.shortcuts import render
from apps.knowledge_fault_tree import models
from rest_framework import viewsets
from apps.knowledge_fault_tree.serializers import FaultTreeSerializer, ProbabilitySerializer

# Create your views here.


class FaultTreeViewSet(viewsets.ModelViewSet):
    queryset = models.FaultTree.objects.all().order_by('-id')
    serializer_class = FaultTreeSerializer


class ProbabilityViewSet(viewsets.ModelViewSet):
    queryset = models.Probability.objects.all()
    serializer_class = ProbabilitySerializer